#include <iostream>
#include <algorithm>
using namespace std;
const int N = 55;
int a[N];
bool cmp(int a,int b)
{
	return a>b;
}
int main()
{
	int n;
	cin >> n;
	for(int i =0;i<n;i++)
	{
		cin >> a[i];
	}
	sort(a,a+n,cmp);
	for(int i =0;i<5;i++)
	{
		cout<<a[i] << " ";
	}
	return 0;
}
